package hu.arguscab.ai.util;

import hu.arguscab.ai.Node;
import hu.arguscab.physic.Vector;

public class QuadNode<N> extends Node<N> {
	private boolean isHomogeneous;
	private Vector center;
	private Vector cornels[] = new Vector[4];
	private Rect rect;

	public QuadNode(Rect r) {
		constructor(r);
	}
	
	public QuadNode(Rect r, N t) {
		super(t);
		constructor(r);
	}
	
	private void constructor(Rect r) {
		this.rect = r;
		center = new Vector( r.getX() + r.getW()/2, r.getY() + r.getH()/2 );
	}
	
	public boolean isHomogeneous() {
		return isHomogeneous;
	}

	public void setHomogeneous(boolean isHomogeneous) {
		this.isHomogeneous = isHomogeneous;
	}

	public Vector getCenter() {
		return center;
	}

	public void setCenter(Vector center) {
		this.center = center;
	}

	public Rect getRect() {
		return rect;
	}

	public void setRect(Rect rect) {
		this.rect = rect;
	}
}